<template>
  <div class="area">
    <div class="text">风险地区</div>
    <div class="high">
      <div class="title">高风险地区{{high.length}}个</div>
      <template v-if="high.length>0">
        <div class="info" v-for="(item,index) in high" :key="index" :title="item">{{item}}</div>
      </template>
    </div>
    <div class="middle">
      <div class="title">中风险地区{{middle.length}}个</div>
      <template v-if="middle.length>0">
        <div class="info" v-for="(item,index) in middle" :key="index" :title="item">{{item}}</div>
      </template>
    </div>
  </div>
</template>

<script>
import api from '@/api/index'
export default {
  data(){
    return{
      high:[],
      middle:[]
    }
  },
  created() {
// 请求疫情热点接口
    api.getCovHot()
      .then(res=>{
        // console.log(res)
        var data=res.data.newslist[0]
        this.high=data.riskarea.high
        this.middle=data.riskarea.mid
        // console.log(this.high)
        // console.log(this.middle)
        // console.log(this.hotArr)
      })
  },
  methods:{
  }
}
</script>

<style lang="less" scoped>
.area{
  background-color: #fff;
  padding: 10px 20px;
  .text{
    border-left: 4px solid orange;
    padding: 0 10px;
  }
  .high{
    .title{
      text-align: center;
      color: red;
      padding: 10px;
    }
    .info{
      padding-left: 10px;
    }
  }
  .middle{
    .title{
      text-align: center;
      color: orange;
      padding: 10px;
    }
    .info{
      padding-left: 10px;
    }
  }
}
</style>

